package com.nyist.myticket.web.common.controller;


import com.alibaba.fastjson.JSON;
import com.nyist.myticket.core.redis.RedisUse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yangxiaogen
 * @since 2021-01-05
 */
@RestController
@RequestMapping("/redis")
public class RedisController {

    private static Logger logger = LoggerFactory.getLogger(RedisController.class);

    /**
     * 获取指定 key 对应 value
     *
     * @param key
     */
    @RequestMapping(value = "/queryValue",method = RequestMethod.GET)
    public String queryValue(String key) {
        logger.info("===============准备获取 redis 的信息==============");
        String value = RedisUse.getValue(key);
        logger.info("===============创建任务成功,信息:{}", JSON.toJSONString(key));
        return value;
    }


}

